<?php 
$content = $_GET['content'];
//if(!isset($_SESSION['sess_uid']) || (trim($_SESSION['sess_role']) == '')) {
session_start();
if (!isset($_SESSION['sess_uid'])){
	header("location: index.php");
	exit();
 } else
 
 {


require_once('db.php');

//Load Default Parameter :
$sql = "select * from tb_setting";
$setting  = @mysql_query($sql,$link);
$data	  = mysql_fetch_array($setting, MYSQL_ASSOC);


?>


<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <base href="" />
    <title>eTaxware : <?php echo $data['site_name']; ?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
			 
	<link rel="shortcut icon" href="assets/images/icon.png" />
    <link rel="stylesheet" href="assets/css/bootstrap.css" type="text/css" charset="utf-8">
    <link rel="stylesheet" href="assets/css/jquery.dataTables.css" type="text/css" charset="utf-8">
	
	<script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="assets/js/bootstrap.js"></script> 
	<script type="text/javascript" src="assets/js/bootbox.js"></script>
	
	<script type="text/javascript" src="assets/js/jquery.dataTables.js"></script>
	
	
	
</head>
    <body>
<div id="wrap">

<div class="navbar navbar-static-top navbar-inverse">
	<div class="container">
		<div class="navbar-header">
        
        <a class="navbar-brand">eTaxware : <?php echo $data['site_name']; ?></a>
	</div>

	<ul class="nav navbar-nav navbar-right">
			<li><a class="hov"> [ UserID : <?php echo $_SESSION["sess_uid"] ?>, Role : <?php echo $_SESSION["sess_role"] ?> ]</a></li>		
			
			
		<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          Reports          <b class="caret"></b></a>
          <ul class="dropdown-menu">
		  
			
            <li><a href="main_bo.php?content=tb_sales">
              List Sales              </a></li>
            <li><a href="index.php?module=sales&view=holded">
              List Open Orders              </a></li>
			  
			<li class="divider"></li>
		  
            <li><a href="index.php?module=reports&view=daily_sales">
              Daily Sales              </a></li>
            <li><a href="index.php?module=reports&view=monthly_sales">
              Monthly Sales              </a></li>
            <li><a href="index.php?module=reports">
              Sales Reports              </a></li>
              <li class="divider"></li>
              <li><a href="index.php?module=reports&view=top">
              Top Products              </a></li>
              <li><a href="index.php?module=reports&view=products">
              Products Reports              </a></li>
          </ul>
        </li> 
		
        <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          Setting          <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="main_bo.php?content=tb_products">
              List Products              </a></li>
            <li><a href="index.php?module=products&view=add">
              List Categories              </a></li>
			<li><a href="index.php?module=products&view=add">
              List Customers              </a></li>
			<li><a href="index.php?module=products&view=add">
              List Bank Account              </a></li>
            <li><a href="index.php?module=products&view=import">
              Import Products (.csv)              </a></li>
			  
            <li class="divider"></li>
            
			<li><a href="index.php?module=products&view=categories">
              Global Setting              </a></li>
            <li><a href="user_mgt.php">
              User Management              </a></li>
          </ul>
        </li>
		<li><a href="logout.php" class="tip" data-placement="left" title="Logout..!">
				<i class="glyphicon glyphicon-log-out"></i>
			</a>
		</li>	
	</ul>
	</div>
</div>

<div class="container">

<div id="fileData_wrapper" class="dataTables_wrapper form-inline" role="grid">
	

<div id="data_container" >

<?php 
if ($content==''){
 echo "<h3>Admin|BackOffice Pages</h3>
	<p class=\"introtext\">Anda dapat melakukan maintenance parameter dan produk di sini</p>";

 } elseif
($content=='tb_sales'){
?>
<h3>SALES</h3>
<p class="introtext">Reports Sales Hari Ini</p>
<table id="sales-1" >	
	<thead>
		<tr>
			<th>BILL ID</th>
			<th>TOTAL ITEMS</th>
			<th>GRAND TOTAL</th>
			<th>PAID BY</th>
			
		</tr>
	</thead>
				
	<tbody role="alert" aria-live="polite" aria-relevant="all" >
	</tbody>
</table>
<?php } elseif
($content=='tb_products'){
?>	
<h3>PRODUCTS</h3>
<p class="introtext">Mainenance Table Procucts</p>
<table id="product-1" >	
	<thead>
		<tr>
			<th>PROD ID</th>
			<th>NAME</th>
			<th>CATEGORY</th>
			<th>SELL PRICE</th>
			<th>ACTIONS</th>
		</tr>
	</thead>
				
	<tbody role="alert" aria-live="polite" aria-relevant="all" >
	</tbody>
</table>
<?php } ?>



</div>	
	
	
	
</div>
<div class="clr"></div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div id="footer">
  <div class="container">
       
  </div>
</div>


</body>
<script language="javascript" class="init">
	$(document).ready(function() {
		display_data('#sales-1','sales-1.php');
		display_data('#product-1','product-1.php');
		
		function display_data(ctnr,hdlr){
			//$('#ctnr').style.visibility = 'hidden';
			$(ctnr).dataTable( {
				
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": hdlr,
				 "tableTools": {"sSwfPath": "/swf/copy_csv_xls_pdf.swf"}
				
			} );
			//$('#ctnr').style.visibility = 'visible';
		}
		
		
	} );
</script>



</html>


<?php 

mysql_close($link);

 }
 ?>